from appstoreserverlibrary.api_client import AppStoreServerAPIClient, APIException
from appstoreserverlibrary.models.Environment import Environment
from appstoreserverlibrary.models.SendTestNotificationResponse import SendTestNotificationResponse

with open("AuthKey_MTF9B284V6.p8", mode='rb') as f:
    private_key = f.read()

key_id = "MTF9B284V6"
issuer_id = "912a8e72-60d0-4237-a078-7fcb42e7ce6c"
bundle_id = "com.qianmiao.tika"
environment = Environment.PRODUCTION

client = AppStoreServerAPIClient(private_key, key_id, issuer_id, bundle_id, environment)

def test():
    try:
        response = client.request_test_notification()
        print(response)
    except APIException as e:
        print(e)

def refund():
    respose = client.get_refund_history("710001464416459", None)
    return respose

if __name__ == '__main__':
    refund()
    pass


